@using AntDesign.Charts
@using Title = AntDesign.Charts.Title
@inject NavigationManager NavigationManager
@inject HttpClient HttpClient

<Tabs>
    <TabPane Key="1">
        <Tab>示例1</Tab>
        <ChildContent>
            <Line @ref="chart1" Data="data1" Config="config1"/>
        </ChildContent>
    </TabPane>
</Tabs>

@code{

    IChartComponent chart1;
    FertilityItem[] data1;


    protected override async Task OnInitializedAsync()
    {
        data1 = await ChartsDemoData.FertilityItemAsync(NavigationManager, HttpClient);
        await chart1.ChangeData(data1);

        await base.OnInitializedAsync();
    }

    #region 示例1

    readonly LineConfig config1 = new LineConfig
    {
        Title = new Title
        {
            Visible = true,
            Text = "配置坐标轴tick数量"
        },
        ForceFit = true,
        Padding = "auto",
        XField = "year",
        YField = "value",
        SeriesField = "country",
        XAxis = new ValueCatTimeAxis
        {
            Type = "dateTime",
            TickCount = 5
        }
    };

    #endregion 示例1

}